﻿<%@ Page  MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="ShipDiscount.aspx.cs" Inherits="RabbitManage.UI.ShipDiscount" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <form id="form1" action="/Action/ShipDiscountAdd.aspx" method="POST">

        <h3>满包邮策略</h3>

    <script type="text/javascript">
        form1.onsubmit = function (e) {
            // stop the regular form submission
            e.preventDefault();

            // collect the form data while iterating over the inputs
            var data = {};
            for (var i = 0, ii = form1.length; i < ii; ++i) {
                var input = form1[i];
                if (input.name) {
                    data[input.name] = input.value;
                }
            }

            // construct an HTTP request
            var xhr = new XMLHttpRequest();
            xhr.open(form1.method, form1.action, true);
            xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');

            // send the collected data as JSON
            xhr.send(JSON.stringify(data));

            xhr.onloadend = function () {
                // done
                if (xhr.responseText == "true") {
                    window.location = "ProductList.aspx";
                } else {
                    alert(xhr.responseText);
                }
            };
        };
    </script>

    <table>
<%--        <tr>
            <td>
                规则名称：
            </td>
            <td>
                <input type="text" id="inputDiscountName" name="DiscountName" style="width: 400px;"   />
            </td>
        </tr>--%>

        <tr>
            <td>
                满包邮：
            </td>
            <td>
                <input type="text" id="inputFreeShipAt" name="FreeShipAt" style="width: 40px; text-align: right;"  />
            </td>
        </tr>
        
    </table>

        <br/>
    
        <input type="submit" value="提交" />

    </form>


</asp:Content>